package com.chinasi.dao.impl;

import java.util.List;

import org.apache.ibatis.session.RowBounds;

import com.chinasi.dao.BidConsumerDao;
import com.chinasi.model.BidConsumer;
import com.chinasi.model.ConsumerBasic;
import com.chinasi.model.mvo.BidAgencyMvo;
import com.chinasi.model.mvo.BidConsultMvo;
import com.chinasi.model.mvo.BidConsumerMvo;
import com.chinasi.model.mvo.BidExpertMvo;
import com.chinasi.model.mvo.BidIntegrationMvo;
import com.chinasi.model.mvo.BidSupvisionMvo;
import com.caland.framework.core.annotation.Dao;
import com.caland.framework.core.page.Pager;
import com.caland.framework.dao.ibatis.impl.MyBatisBaseDaoImpl;

@Dao
public class BidConsumerDaoImpl extends MyBatisBaseDaoImpl<BidConsumer, java.lang.String> implements BidConsumerDao {

	private static final String SQL_PREFIX = "com.chinasi.model.BidConsumer.";
	@Override
	public List<BidConsumerMvo> findRelationBid(BidConsumer searchBean,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationBid", searchBean, rowBounds);
	}
	@Override
	public int getRelationConsultTotalCount(ConsumerBasic consumer) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsultTotalCount", consumer);
	}
	@Override
	public List<BidConsultMvo> findRelationConsult(ConsumerBasic consumer,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsult", consumer, rowBounds);
	}
	@Override
	public int getRelationIntegratorTotalCount(ConsumerBasic consumer) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsultTotalCount", consumer);
	}
	@Override
	public List<BidIntegrationMvo> findRelationIntegrator(
			ConsumerBasic consumer, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationIntegration", consumer, rowBounds);
	}
	@Override
	public int getRelationAgencyTotalCount(ConsumerBasic consumer) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationAgencyTotalCount", consumer);
	}
	@Override
	public List<BidAgencyMvo> findRelationAgency(ConsumerBasic consumer,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationAgency", consumer, rowBounds);
	}
	@Override
	public int getRelationSupervisionTotalCount(ConsumerBasic consumer) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationSupervisionTotalCount", consumer);
	}
	@Override
	public List<BidSupvisionMvo> findRelationSupervision(
			ConsumerBasic consumer, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationSupervision", consumer, rowBounds);
	}
	@Override
	public int getRelationExpertTotalCount(ConsumerBasic consumer) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationExpertTotalCount", consumer);
	}
	@Override
	public List<BidExpertMvo> findRelationExpert(ConsumerBasic consumer,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationExpert", consumer, rowBounds);
	}

}
